<?php require_once(dirname(__FILE__).'/../include/config.inc.php');
require_once "function.php";
/*
进度：
0 已经撤单
1 报修成功
2 客服已经联系
3 系统已经派单
4 工程师接单
5 维修完成
6 已经评价
*/

$uid=$_SESSION['uid'] ;
$userInfo="";
if(isset($uid)){

		//有session 从数据库中读取用户名信息
	 	//$openid_str=$_SESSION['openid'];
		$row = $dosql->GetOne("SELECT * FROM `#@__user`  WHERE id='$uid'");
			if(is_array($row) && isset($row['id'])){
				// 返回用户 id 
				$id=$row['id'];
				$_SESSION['id'] = $id;
				$userInfo=$row;
			}
}
//分类统计
$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`=1 AND uid='$uid' and apply_type='1'  ",1);
$count1=$dosql->GetTotalRow(1); //报修完成

$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`=3  AND uid='$uid' and apply_type='1'   ",3);
$count3=$dosql->GetTotalRow(3); //报修完成

$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`=4  AND uid='$uid' and apply_type='1'   ",4);
$count4=$dosql->GetTotalRow(4); //报修完成

$dosql->Execute("SELECT `id` FROM `#@__order` WHERE  `jindu`>4 AND uid='$uid'  and apply_type='1'  ",5);
$count5=$dosql->GetTotalRow(5); //报修完成

$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`=5 AND uid='$uid'  and apply_type='1'  ",6);
$count6=$dosql->GetTotalRow(6); //报修完成

//分类统计
$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`=1 AND uid='$uid' and apply_type='2'  ",11);
$count21=$dosql->GetTotalRow(11); //报修完成

$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`=3 AND uid='$uid' and apply_type='2'  ",13);
$count23=$dosql->GetTotalRow(13); //报修完成

$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`=4  AND uid='$uid' and apply_type='2'   ",14);
$count24=$dosql->GetTotalRow(14); //报修完成

$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`>4 AND uid='$uid'  and apply_type='2'  ",15);
$count25=$dosql->GetTotalRow(15); //报修完成

$dosql->Execute("SELECT `id` FROM `#@__order` WHERE `jindu`=5 AND uid='$uid'  and apply_type='2'  ",16);
$count26=$dosql->GetTotalRow(16); //报修完成

?>
<!DOCTYPE html>
<html>
<head>
<title>客户中心-<?php echo $cfg_webname;?></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="<?php echo $cfg_webname;?>">
<link rel="stylesheet" href="lib/weui.min.css">
<link rel="stylesheet" href="css/jquery-weui.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/demos.css">
</head>

<body ontouchstart>
<div class="top">
  <div class="user_top">
          <i>
   UID:<?php echo $uid;?>
    </i>
    <div class="user_top_conn"> <img src="<?php echo $userInfo['headimgurl']?>"/>
      <p><?php echo $userInfo['nickname']?></p>
    </div>
  </div>
</div>
<div class="main"> 
  <!-- 工单状态 -->
  <div class="Order">
    <dl>
      <a href="order.php">
      <dt><strong><i class="fa fa-server" aria-hidden="true"></i>报修服务</strong><span>查看全部报修</span></dt>
      </a>
    </dl>
    <ul>
      <li><a href="order.php?jindu=1&apply_type=1"><em class="ordem3"><i><?php echo $count1?></i></em><span>报修成功</span></a></li>
      <li><a href="order.php?jindu=3&apply_type=1" ><em class="ordem2"><i><?php echo $count3?></i></em><span>已派单</span></a></li>
      <li><a href="order.php?jindu=4&apply_type=1" ><em class="ordem1"><i><?php echo $count4?></i></em><span>维修中</span></a></li>
      <li><a href="order.php?jindu=5&apply_type=1"><em class="ordem4"><i><?php echo $count5?></i></em><span>已完成</span></a></li>
      <li ><a href="pingping.php?apply_type=1"><em class="ordem5"><i><?php echo $count6?></i></em><span>待评价</span></a></li>
    </ul>
  </div>
</div>



<!-- 工单状态 / --> 
<!-- 其他信息 -->
<div class="main">
  <div class="Wallet main_top">
    <a href="order.php?jindu=6"><em class="ordem5"></em>
    <dl class="border_bottm">
      <dt>服务评价</dt>
      <dd>评价列表</dd>
    </dl>
    </a> 
  
    <a href="address.php?call=member"><em class="Icon3"></em>
    <dl class="border_bottm">
      <dt>我的地址</dt>
      <dd>添加/修改</dd>
    </dl>
    </a> 
    </a> 
        </a> <a href="page.php?cid=2"><em class="Icon2"></em>
    <dl class="border_bottm">
      <dt>关于<?php echo $cfg_webname;?></dt>
      <dd><?php echo $cfg_webname;?> 简介</dd>
    </dl>
    </a> 
<!--    <a href="logout.php"><em class="Icon4"></em>-->
<!--    <dl class="border_bottm">-->
<!--      <dt>退出登录</dt>-->
<!--      <dd>点击退出</dd>-->
<!--    </dl>-->
<!--    </a> -->
    </div>
</div>
<!-- 其他信息 /-->
</div>
<div class="clear"></div>
<script src="lib/jquery-2.1.4.js"></script> 
<script src="lib/fastclick.js"></script> 
<script>
  $(function() {
    FastClick.attach(document.body);
  });
</script> 
<script src="js/jquery-weui.js"></script> 
<script src="js/city-picker.js"></script> 
<script>

</script>
  <div class="sub_btn"></div>
<?php require_once('footer.php'); ?>